using System;

namespace Tino.Core
{
    /// <summary>
    /// Singleton class to manage contextuel information, such as ConnectionString
    /// </summary>
    public class Context
    {
        static Context instance;
        static readonly object padlock = new object();

        string connectionString = string.Empty;

        protected Context() { }

        static public Context Current
        {
            get
            {
                lock (padlock)
                {
                    if (instance == null)
                        instance = new Context();

                    return instance;
                }
            }
        }

        public string ConnectionString
        {
            get { return connectionString; }
            set { connectionString = value; }
        }
    }
}
